package cn.iocoder.yudao.module.cmt.dal.mysql.person;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.cmt.dal.dataobject.person.PersonVolunteerApplyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.cmt.controller.admin.person.vo.*;

/**
 * 志愿者/师资注册申请 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PersonVolunteerApplyMapper extends BaseMapperX<PersonVolunteerApplyDO> {

    default PageResult<PersonVolunteerApplyDO> selectPage(PersonVolunteerApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PersonVolunteerApplyDO>()
                .eqIfPresent(PersonVolunteerApplyDO::getCommunityId, reqVO.getCommunityId())
                .eqIfPresent(PersonVolunteerApplyDO::getUserId, reqVO.getUserId())
                .eqIfPresent(PersonVolunteerApplyDO::getPersonId, reqVO.getPersonId())
                .eqIfPresent(PersonVolunteerApplyDO::getApplyType, reqVO.getApplyType())
                .likeIfPresent(PersonVolunteerApplyDO::getRealName, reqVO.getRealName())
                .eqIfPresent(PersonVolunteerApplyDO::getGender, reqVO.getGender())
                .likeIfPresent(PersonVolunteerApplyDO::getPhone, reqVO.getPhone())
                .eqIfPresent(PersonVolunteerApplyDO::getAuditStatus, reqVO.getAuditStatus())
                .betweenIfPresent(PersonVolunteerApplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PersonVolunteerApplyDO::getId));
    }

}
